package com.yzt.zhuju.service;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class LocationService extends Service {

    public interface OnSendSuccess {

        void onSend();

        void onError();
    }

    public static OnSendSuccess onSendSuccess;

    public static void sendLocation(Context activity, OnSendSuccess onSendSuccess, String loginUserId, String access_token) {
        LocationService.onSendSuccess = onSendSuccess;
        Intent intent = new Intent(activity, LocationService.class);
        intent.putExtra("loginUserId", loginUserId);
        intent.putExtra("access_token", access_token);
        activity.startService(intent);
    }

    public static void stop(Context activity) {
        Intent intent = new Intent(activity, LocationService.class);
        activity.stopService(intent);
    }

    public LocationService() {
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d("location", "onStartCommand: ");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
